package com.qijian.listener;

import com.google.common.eventbus.SubscriberExceptionContext;
import com.google.common.eventbus.SubscriberExceptionHandler;
import com.qijian.common.exception.ServiceException;

public class SubscriberExceptionHandlerImpl implements SubscriberExceptionHandler {

    static ThreadLocal<ServiceException> threadLocal = new ThreadLocal();
    @Override
    public void handleException(Throwable throwable, SubscriberExceptionContext subscriberExceptionContext) {
        if (throwable instanceof  ServiceException) {
            threadLocal.set((ServiceException) throwable);
        }

    }
}
